using System;
using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
using UnityEngine;



public class GameManager : Singleton<GameManager>
{
    public GameController gameController;

    public List<int> recardStep = new List<int>();
    public List<bool> stepLeftOrRight = new List<bool>();

    protected override void Awake()
    {
        base.Awake();
        
        DOTween.SetTweensCapacity(122062,50);
    }

    public void NewGame()
    {
        var level = LevelManager.Instance.levelList[LevelManager.Instance.currentLevelIndex];
        recardStep.Clear();
        stepLeftOrRight.Clear();
        gameController.Init(level);
        Debug.LogFormat("NewGame Level : {0} , cellNums : {1}",LevelManager.Instance.currentLevelIndex,level.row*level.col);
    }

    public void SaveGame()
    {
        
    }

    public void LoadGame()
    {
        var level = SaveManager.Instance.LoadLevel(LevelManager.Instance.currentLevelIndex);
        Debug.LogFormat("LoadGame level : {0},  cellNums : {1}",LevelManager.Instance.currentLevelIndex,level.cells.Count);
        recardStep = level.recardStep;
        stepLeftOrRight = level.stepLeftOrRight;
        gameController.ContinueGame(level);
    }
    
}
